package com.siyuanren.gcocp.enums.wx;

import lombok.Getter;

import java.util.Objects;

/**
 * 模版消息任务通知Task类型
 *
 * @author guwr
 */
@Getter
public enum TemplateContentEnum {
    STUDENT_NOTICE_BDTZ(1, 1, "学员通知", "报到通知", "助教Riva提醒你\n\n【%s】第%s期已开放报到\n\n报到将于今晚12点截止，报到成功才能跟随班主任引领学习，请尽快报到！\n\n如放弃报到，视为自动放弃引领。"),
    STUDENT_NOTICE_BYDL(1, 2, "学员通知", "毕业典礼", "助教Riva提醒你，\n\n今天是【%s】的毕业典礼以开放。\n\n请及时进入系统打印毕业证书。"),
    STUDENT_NOTICE_KCLQ(1, 3, "学员通知", "活动参加", "助教Riva提醒你，\n\n你有一份【%s】优惠券待领取\n\n数量有限，领完即止"),
    STUDENT_NOTICE_DBRWTX(1, 4, "学员通知", "开放学习", "助教SiSi提醒你\n\n【%s】 已开放学习"),
    STUDENT_NOTICE_LQKCTX(1, 5, "学员通知", "课程报道提醒", "亲爱的学员，你报名【%s】课程已开放入学报到，请及时进入系统完成报到。"),
    TEMPLATECONTENT_SKTX_AM(2, 1, "上课提醒", "上课提醒AM", "你订阅的课程今天内容已更新，请及时完成"),
    TEMPLATECONTENT_SKTX_PM(2, 2, "上课提醒", "上课提醒PM", "你今天订阅的学习任务还没有完成，请及时完成哦"),
    PROJECT_PROGRESS_NOTICE_YHJBM_ING(3, 1, "项目进度通知", "优惠券领取", "你的好友%s已经使用你的邀请卡报名【%s】 你还需邀请%s人即可获得【%s】%s元优惠券"),
    PROJECT_PROGRESS_NOTICE_YHJBM_FINAL(3, 2, "项目进度通知", "优惠券领取", "你已经完成邀请，获得【%s】%s元优惠券"),;
    private int templateId;
    private int value;
    private String taskTitle;
    private String taskSummary;
    private String taskContent;

    TemplateContentEnum(int templateId, int value, String taskTitle, String taskSummary, String taskContent) {
        this.templateId = templateId;
        this.value = value;
        this.taskTitle = taskTitle;
        this.taskSummary = taskSummary;
        this.taskContent = taskContent;
    }

    public static TemplateContentEnum getModel(int templateId, int value) {
        for (TemplateContentEnum he : TemplateContentEnum.values()) {
            boolean templateIdB = Objects.equals(templateId, he.getTemplateId());
            boolean valueB = Objects.equals(value, he.getValue());
            if (templateIdB && valueB) {
                return he;
            }
        }
        return null;
    }
}